{% extends 'layout.html' %}
{% block style %}
{% endblock %}
{% block body %}
    <div><h3>编辑</h3></div>
    <form method="post" action="{{ url_for('edit_post') }}">
    <input type="hidden" name="id" value="{{ post.id }}"/>
    <div class="form-group">
        <input type="text" class="form-control" name="title" value="{{ post.title }}" placeholder="标题"/>
    </div>
    <div class="form-group">
        <input type="text" class="form-control" name="keyword" value="{{ post.keyword }}" placeholder="关键词"/>
    </div>
        <div class="form-group">
        <textarea class="form-control" placeholder="文章内容" id="content" name="content" rows="6" style="height:400px;">{{ post.content }}</textarea>
        </div>
    <div>
        <button class="btn btn-primary">保存</button>
    </div>
    </form>
{% endblock %}
{% block footer %}
    <script src="{{ url_for('static', filename='script/tinymce/tinymce.min.js') }}"></script>
    <script>
        tinymce.init({
            selector:'#content',
            branding: false,
            menubar: false,
            plugins: ["advlist autolink lists link image charmap print preview anchor",
        "searchreplace visualblocks code fullscreen",
        "insertdatetime media table contextmenu paste imagetools code"],
            toolbar: 'undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify alignnone | indent outdent | blockquote link image media | code'
        });
    </script>
{% endblock %}